1. Field of the Invention
The present invention is directed to displacing or offsetting surfaces and, more particularly, to a system that provides a higher density of tessellation where detail of the object is the greatest.
2. Description of the Related Art
In the field of computer graphics, there are various approaches to adding visual complexity to a surface. Texture mapping and bump mapping have been used to add visual effects to surfaces. Bump mapping perturbs surface normals but does not alter the actual surface geometry, causing artifacts that are particularly noticeable from silhouette views. Both approaches leave the actual geometry of the surface smooth and unaltered, regardless of the complexity of the mapping. Shadowing and reflection are also problematic. These problems can be avoided by altering the surface geometry to add detail or complexity to the surface. This approach, called displacement mapping, avoids shortcomings related to texture and bump mapping.
A displacement map is a way of using a scalar height field h(x,y) to specify an offset surface S′(x,y). Given a surface S(x,y) with normal field N(x,y), the offset surface is defined as S′(x,y)=S(x,y)+h(x,y)N(x,y). This offsetting operation presents numerous problems, including problems in performing the offset operation, and problems with the final offset surface, which is usually a polygonal mesh.
In rendering applications, surfaces are often represented by meshes, whereas height fields are often represented by parametric mappings that are unrelated to the surface. One way of offsetting a mesh surface is to simply displace vertices of the mesh according to the height field and the normals of the surface. However, the resulting offset surface mesh will have a vertex density on the order of the original surface. As a result, a vertex-sparse original mesh often results in a displaced mesh that has too few vertices to accurately represent complex features of the height field, such as curves and edges, resulting in an undersampled or coarse offset surface. Furthermore, offsetting a vertex-dense original mesh requires increased computing resources, and often results in a displaced mesh that has more vertices than are necessary to portray the features and complexity of the height field. The number of unnecessary vertices in a vertex-dense offset mesh is usually significant, and impractical or impossible computing resources are often required to store and manipulate the mesh. Furthermore, even vertex-dense meshes often contain artifacts such as stripes, cracks, and zippers.
Micropolygon decomposition is another unsatisfactory displacement approach. FIG. 1 shows a surface displaced with micropolygon decomposition 50. This approach tessellates each surface into polygons that are smaller than a quarter of a screen pixel. Because geometry is rendered in surface order, clipped to the size of screen tiles, and then immediately purged once shaded, the practical incurred memory cost of an otherwise explicitly high polygon density from such a tessellation is minimal. However, this approach produces cracks, and produces stretched polygons for rapidly varying displacement maps.
Simplifying a dense offset mesh is also not satisfactory because large amounts of temporary memory are still required to store the initial dense offset mesh. Furthermore, high tessellation densities may be initially encountered, even where the displacement features are sparse.
What is needed is an efficient displacement mapping technique that produces high-quality displacement mapped surfaces that optimally represent the features and complexity of the displacing height field.